package com.example.tests;

/**
 * Created with IntelliJ IDEA.
 * User: pshevchenko
 * Date: 19.03.13
 * Time: 19:26
 * To change this template use File | Settings | File Templates.
 */
public class PhoneData implements Comparable<PhoneData> {
    private String contactPhone;
    private String fullName;
    private String birthDate;

    public PhoneData(AddressData addressData){
        contactPhone = addressData.getContactPhone();
        fullName = addressData.getFullName();
        birthDate = addressData.getBirthDate();
    }

    public PhoneData(){
        this(new AddressData());
    }

    public String getBirthDate() {
        return birthDate;
    }

    public String getContactPhone() {
        return contactPhone;
    }

    public String getFullName() {
        return fullName;
    }



    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PhoneData phoneData = (PhoneData) o;

        if (contactPhone != null ? !contactPhone.equals(phoneData.contactPhone) : phoneData.contactPhone != null)
            return false;
        if (fullName != null ? !fullName.equals(phoneData.fullName) : phoneData.fullName != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = contactPhone != null ? contactPhone.hashCode() : 0;
        result = 31 * result + (fullName != null ? fullName.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "PhoneData{" +
                "contactPhone='" + contactPhone + '\'' +
                ", fullName='" + fullName + '\'' +
                '}';
    }

    @Override
    public int compareTo(PhoneData o) {
        return 0;
    }
}
